/*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Alternatively, this software may be distributed under the terms of BSD
* license.
*
*
*
* Authors:                  zhoujian
* Email:            343600434@qq.com
* Date:         Sep-04-2024 18:22:39
*
*/


#ifndef __speed_fifo_H__
#define __speed_fifo_H__


#include "stdint.h"

#ifdef __cplusplus
extern "C" {
#endif

#define     _FIFO_MASK      0x3F
#define     _FIFO_LEN       (_FIFO_MASK + 1)


struct FIFO_CTRL {
    unsigned char  flag;
    unsigned char  value;
    unsigned char  head;
    unsigned char  tail;
    uint16_t  dat[_FIFO_LEN];
};

void speed_fifo_init(void);
void  speed_in(uint16_t sp_value);

unsigned char speed_out(uint16_t*   item);


#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
class speed_fifo
{

public:
    speed_fifo();
    ~speed_fifo();

};
#endif



#endif
